package common

const (
	// ContextKeyUserObj 上下文用户对象
	ContextKeyUserObj = "authedUserObj"
	// RedisPrefixAuth redis 权限验证前缀
	RedisPrefixAuth = "auth:"
	// TokenKey 动态token密钥key
	TokenKey     = "Authorization"
	BearerLength = len("Bearer ")
)

const (
	// MsgOk 成功
	MsgOk = 200
	// Found 资源发生改变
	Found = 302
	// BadRequest 请求错误
	BadRequest = 400
	// Unauthorized 未认证
	Unauthorized = 401
	// NotAcceptable 不被允许的操作
	NotAcceptable = 406
	// MsgErr 异常
	MsgErr = 500
	// ConvertErr 转换异常
	ConvertErr = 501
	// ArgsValidErr 参数验证错误
	ArgsValidErr = 503
	// DatabaseOperationErr 数据库操作出错
	DatabaseOperationErr = 504
	UnmarshalErr         = 505
	// ParseFormErr 解析表单数据异常
	ParseFormErr = 506
)

// ConfigDataTypeDict 配置类型
var ConfigDataTypeDict = map[string]string{
	"text":     "单行文本",
	"textarea": "多行文本",
	"ueditor":  "富文本编辑器",
	"date":     "日期",
	"datetime": "时间",
	"number":   "数字",
	"select":   "下拉框",
	"radio":    "单选框",
	"checkbox": "复选框",
	"image":    "单张图片",
	"images":   "多张图片",
	"password": "密码",
	"icon":     "字体图标",
	"file":     "单个文件",
	"files":    "多个文件",
	"hidden":   "隐藏",
	"readonly": "只读文本",
}
